﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.Web.UI.HtmlControls;

using AjaxControlToolkit;
using BizElements.Core;
using BizElements.BusinessLayer;

namespace BizElements.Web
{
    /// <summary>Represents bindings between <see cref="BizElements.BusinessLayer.IBusinessObject"/> and user interface controls.</summary>
    public sealed class EntityBindingContext : IEntityBindingContext
    {
        #region CTor.

        /// <summary>Initializes a new instance of <b>EntityBindingContext</b> class.</summary>
        public EntityBindingContext()
        {
            this.ChildrenBindings = new List<IChildrenBinding>();
            this.ParentBindings = new List<IParentBinding>();
            this.ComplexPropertyBindings = new List<IComplexPropertyBinding>();
        }

        #endregion

        #region Properties.

        /// <summary>Gets or sets field bindings.</summary>
        public IValueObjectBindingContext FieldBindings { get; set; }

        /// <summary>Gets a collection of parent entity bindings.</summary>
        public IList<IParentBinding> ParentBindings { get; private set; }

        /// <summary>Gets a collection of children bindings.</summary>
        public IList<IChildrenBinding> ChildrenBindings { get; private set; }

        /// <summary>Gets a collection of complex property, ie. extension child entity, bindings.</summary>
        public IList<IComplexPropertyBinding> ComplexPropertyBindings { get; private set; }

        #endregion
    }
}
